<extend name="Public/base"/>

<!-- 子导航 -->
<block name="sidebar">
    <include file="sidemenu" />
</block>
<!-- css样式 -->
<block name="body">
    <style type="text/css">
        #houtai{color: #404040;font-weight: bold;}
        .xian{float: none;padding-top: 69px;}
        .muban{float:left;font-size: 18px;color: #404040;line-height: 36px;}
        .f1{margin-left: 10px;}
        #f2{width: 228px;height: 32px;margin-left:2px;}
        .data-table,td{border: 1px solid lightgrey;margin-top:45px;}
        .xinzen{float:left;margin-top:3px;margin-left: 28px;}
        .biao{width: 180px;height: 28px;margin-left: 20px;line-height: 15px;}
        .word{font-family: "Arial Negreta","Arial Normal","Arial";  font-style: normal;  font-weight: 700;  text-align: right;}
        .modal-body{margin-left: 140px;line-height: 40px;margin-top: 20px;}
        .f3{ background-color: #4bbd00;  color: #edffd1;font-size: 14px;  line-height: 27px;padding: 0.5px 14px;  }
        #full_full{font-weight: bold;}

    </style>
    <div class="main-title">
        <h2 id="houtai"><span>管理后台</span></h2>
    </div>
    <!-- 工具栏 -->
    <div class="product_headcut">
        <div class="f1">
            <!-- 高级搜索 -->
            <form method="get"action="{:U('Active/addGroup')}"  class="form-horizontal search-form">
                <div class="muban">模板名称：</div>
                <input id="f2" name='title' class="search-input"  value="{$groupinfo.title}" placeholder="模板名称">
                <div class="xinzen">
                    <input class="f3"name="title" type="button" onclick="f3()" value=新建模板>
                    <a class="btn" id='search' url="admin.php?s=/Active/group.html">筛选</a>
                </div>
            </form>
        </div>
        <div class="xian">
            <hr>
        </div>
        <!-- 数据表格 -->
        <div class="data-table">
            <table>
                <!-- 表头 -->
                <thead>
                <tr>
                    <th>ID</th>
                    <th>模板名称</th>
                    <th>团类型</th>
                    <th>成团周期</th>
                    <th>成团人数</th>
                    <th>抽奖人数</th>
                    <th>单张面额</th>
                    <th>使用条件</th>
                    <th>全场通用</th>
                    <th>优惠券有效期</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <notempty name="_list">
                    <volist name="_list" id="vo">
                        <tr>
                            <td>{$vo.id}</td>
                            <td>{$vo.title}</td>
                            <td>{$vo.type}</td>
                            <td>{$vo.cycle}</td>
                            <td>{$vo.clusters}</td>
                            <td>{$vo.lottery}</td>
                            <td>{$vo.denomination}</td>
                            <td>{$vo.conditions}</td>
                            <td>{$vo.application}</td>
                            <td>{$vo.validity}</td>
                            <td>
                                <a href="admin.php?s=/Active/grouprelation/id/{$vo.id}.html">关联商品</a>&nbsp;&nbsp;&nbsp;
                                <a href="admin.php?s=/Active/group.html">编辑</a>&nbsp;&nbsp;&nbsp;
                                <a href="{:U('Good/deletegood', array('id' => $vo['id']))}" onclick="if(!confirm('确定删除商品?')){return false;}">刪除</a>
                            </td>
                        </tr>
                    </volist>
                </notempty>

            </table>
        </div>
    </div>
    </div>
    <form  method="post" action="{:U('Active/addSuperGroup')}" class="form-horizontal">  <!-- 上传数据库 -->
        <div class="modal" style="display:none;">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button aria-label="Close" data-dismiss="modal" class="close modal-close" type="button"><span aria-hidden="true">×</span></button>
                        <h4 id="gridModalLabel" class="modal-title">编辑模块</h4></div>
                    <div class="modal-body">
                        <div> <span class="word">模板名称：</span><input class="biao" name='title'   value="{$groupinfo.title}"></div>
                        <div><span class="word">团类型 ：</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <select class="type"name="type"value="{$groupinfo.type}"  style="width: 185px;"><option value="2">抽奖</option></select>
                            <div> <span class="word">成团周期：</span><input class="biao" name='cycle'   value="{$groupinfo.cycle}" > <span class="word">分</span></div>
                            <div> <span class="word">成团人数：</span><input class="biao" name='clusters'   value="{$groupinfo.title}" ></div>
                            <div> <span class="word">团长特权：</span><input class="biao" name='privilege'   value="{$groupinfo.privilege}" ></div>
                            <div> <span class="word">抽奖人数：</span><input class="biao" name='lottery'   value="{$groupinfo.lottery}" ></div>
                            <div id="full_full" class="full">
                                未抽中者返优惠卷：
                                <div class="coupon">
                                    <div>
                                        <span class="red">*</span>单张面额：
                                        <input  name='denomination' class="biao" value="{$couponinfo.denomination}" placeholder="最大输入99999">
                                    </div>
                                    <div>
                                        <span class="red">*</span>使用条件：
                                        <input  name='conditions' class="biao" type="text" placeholder="单笔订单金额满"value="{$couponinfo.conditions}">元可用使用
                                    </div>
                                    <div>
                                        <span class="red">*</span>适用范围：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                        <input name="application" type="radio"value="1" >
                                        <eq name="couponinfo.range" value="1"> checked="true" </eq>全场通用
                                    </div>
                                    <div>
                                        <span class="red">*</span>优惠卷有效期：
                                       <input  name='validity' class="biao" type="text"value="{$couponinfo.validity}">天有效
                                    </div>

                        </div>
                        <div class="modal-footer">
                            <input class="btn submit-btn ajax-post" id="sbmit" type="submit" target-form="form-horizontal" value="确定" />
                            <button aria-label="Close" data-dismiss="modal" class="btn btn-return modal-close" type="button">取消</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
                </div>
            </div>
    </form>
</block>
<block name="script">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <script type="text/javascript">
        $(function() {
            //搜索功能
            $("#search").click(function () {
                var url = $(this).attr('url');
                var query = $('.search-form').serialize();
                query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
                query = query.replace(/^&/g, '');
                if (url.indexOf('?') > 0) {
                    url += '&' + query;
                } else {
                    url += '?' + query;
                }
                window.location.href = url;
            });
            //回车搜索
            $(".search-input").keyup(function (e) {
                if (e.keyCode === 13) {
                    $("#search").click();
                    return false;
                }
            });
            //导航高亮
            highlight_subnav('admin.php?s=/Active/supergroup.html');
        });
        //弹出框
        function f3(){
            $(".modal").show();
        }
        $(".modal-close").click(function(){
            $(".modal").hide();
        })
    </script>
</block>
